home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / pibt3sp3.arc / RECEIVEY.PAS < prev    next >
Pascal/Delphi Source File  |  1985-08-26  |  3KB  |  73 lines

  1. (*----------------------------------------------------------------------*)
  2. (*          Receive_Ymodem_File --- Download files with Ymodem          *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Receive_Ymodem_File;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*     Procedure:  Receive_Ymodem_File                                  *)
  10. (*                                                                      *)
  11. (*     Purpose:    Downloads file to PC using Ymodem batch              *)
  12. (*                                                                      *)
  13. (*     Calling Sequence:                                                *)
  14. (*                                                                      *)
  15. (*        Receive_Ymodem_File;                                          *)
  16. (*                                                                      *)
  17. (*     Calls:   Receive_Xmodem_File                                     *)
  18. (*                                                                      *)
  19. (*----------------------------------------------------------------------*)
  20.  
  21. VAR
  22.    Local_Save : Saved_Screen_Ptr;
  23.  
  24. BEGIN (* Receive_Ymodem_File *)
  25.  
  26.                                    (* Open display window for transfers  *)
  27.    Save_Screen( Local_Save );
  28.  
  29.    Draw_Menu_Frame( 2, 2, 79, 24, Menu_Frame_Color,
  30.                     Menu_Text_Color,
  31.                     'Batch file download using Ymodem' );
  32.  
  33.    Writelne( 'Batch file donwload using Ymodem', FALSE );
  34.  
  35.    Window( 3, 3, 78, 23 );
  36.                                    (* Flags if keyboard halt or    *)
  37.                                    (* null file name encountered   *)
  38.    Stop_Receive   := FALSE;
  39.    Null_File_Name := FALSE;
  40.                                    (* Loop until null file name    *)
  41.  
  42.    WHILE ( ( NOT Stop_Receive ) AND ( NOT Null_File_Name ) ) DO
  43.       BEGIN
  44.          FileName := '';
  45.          Receive_Xmodem_File( TRUE );
  46.          TextColor( Menu_Text_Color );
  47.          IF ( ( NOT Null_File_Name ) AND ( NOT Stop_Receive ) ) THEN
  48.             Writelne('  Received file: ' + FileName , TRUE );
  49.       END;
  50.                                    (* Acknowledge null file name *)
  51.                                    (* if received                *)
  52.    IF Null_File_Name THEN
  53.       BEGIN
  54.          Writelne(' ', TRUE);
  55.          Writelne('  Received null file name from host.', TRUE);
  56.       END;
  57.                                    (* Indicate end of transfer    *)
  58.    Writelne(' ', TRUE);
  59.  
  60.    RvsVideoOn ( Menu_Text_Color, BackGround_Color );
  61.  
  62.    Writelne('  Batch transfer complete.', TRUE);
  63.  
  64.    RvsVideoOff( Menu_Text_Color, BackGround_Color );
  65.  
  66.    DELAY( Two_Second_Delay );
  67.                                    (* Remove batch transfer window *)
  68.    Restore_Screen( Local_Save );
  69.  
  70.    Reset_Global_Colors;
  71.  
  72. END   (* Receive_Ymodem_File *);
  73.